<style lang="less" scoped>
.panel {
  margin-bottom: 10px;
  &-title {
    display: flex;
    padding: 10px;
    border-bottom: 0.1px solid #eaeaea;
    background: white;

    &__label {
      flex: 1;
      font-size: 16px;
      align-items: center;
    }
  }
  &-content {
    margin-bottom: 10px;
    background: white;
    display: flex;

    &__dec {
      flex: 1;
    }
    &__arrow {
      display: flex;
      align-items: center;
    }
    &__item {
      display: flex;
      padding: 10px 10px 0 10px;
      font-size: 14px;
      &-label {
        color: #666;
      }
      &-value {
        flex: 1;
        padding-left: 15px;
        color: #333;
      }
    }
  }
}
</style>

<template>
  <div class="info" v-if="items.length==0">暂无数据</div>
  <div class="panel" v-else>
    <template v-for="(item, index) in items" wx:key="unique">
      <!-- content -->
      <div class="panel-content" :key="'content'+index" @click="itemClick(item)">
        <div class="panel-content__dec">
          <div class="panel-content__item">
            <div class="panel-content__item-label">登记编号</div>
            <div class="panel-content__item-value">{{item.RegistNo||'-'}}</div>
            <div class="panel-content__item-right"></div>
          </div>
          <div class="panel-content__item">
            <div class="panel-content__item-label">出质人</div>
            <div class="panel-content__item-value">{{item.PledgorInfo&&item.PledgorInfo.Name||'-'}}</div>
            <div class="panel-content__item-right"></div>
          </div>
          <div class="panel-content__item">
            <div class="panel-content__item-label">质权人</div>
            <div class="panel-content__item-value">{{item.PledgeeInfo&&item.PledgeeInfo.Name||'-'}}</div>
          </div>
          <div class="panel-content__item">
            <div class="panel-content__item-label">状态</div>
            <div class="panel-content__item-value">{{item.Status||'-'}}</div>
          </div>
        </div>
        <div class="panel-content__arrow">
          <i class="iconfont icon-more"></i>
        </div>
      </div>
    </template>
  </div>
</template>
<script>
export default {
  data() {
    return {
      items: []
    };
  },
  onLoad() {
    this.getInfos();
  },
  methods: {
    async getInfos() {
      // 获取裁判文书数据
      try {
        const Pledge = this.$store.getters.companyInfo.Company.Pledge;
        this.items = Pledge;
      } catch (error) {}
    },
    itemClick(item) {
      // 展示详情
      this.$router.push({
        path: './detail/main',
        query: { item: JSON.stringify(item) }
      });
    }
  }
};
</script>
